package com.ssy.lingxi.order.repository;

import com.ssy.lingxi.order.entity.DeliveryPlanOrderDO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 *  送货计划-送货物料-物料订单详情Jpa仓库
 * @author czh
 * @date 2022/2/21
 * @version 2.0.0
 */
@Repository
public interface DeliveryPlanOrderRepository extends JpaRepository<DeliveryPlanOrderDO, Long>, JpaSpecificationExecutor<DeliveryPlanOrderDO> {

    DeliveryPlanOrderDO findFirstByOrderProductId(Long orderProductId);

    void deleteByOrderProductIdIn(List<Long> orderProductIds);

    List<DeliveryPlanOrderDO> findByOrderProductIdIn(List<Long> orderProductId);

    List<DeliveryPlanOrderDO> findByOrderProductIdInAndPlanId(List<Long> orderProductId,Long planId);

    void deleteByPlanId(Long id);
}
